package com.pengpeng.server.controller;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.pengpeng.server.entity.ClientMessage;
import com.pengpeng.server.logic.service.PengPengServerService;

@Controller
public class PengPengServerController {
	
	PengPengServerService ppserverservice;
	
	@RequestMapping(value="/{phonenum}/{clienttype}/{messages}",method=RequestMethod.GET)
	@ResponseBody
	public String doGet(@PathVariable String phonenum,@PathVariable String clienttype,@PathVariable String messages)
   {
		ClientMessage clientmessage=new ClientMessage();
		clientmessage.setClienttype(clienttype);
		clientmessage.setMessages(messages);
		clientmessage.setPhonenum(phonenum);
		return ppserverservice.doService(clientmessage);
		
	}

	public PengPengServerService getPpserverservice() {
		return ppserverservice;
	}

	@Resource(name="pengpengServerService")
	public void setPpserverservice(PengPengServerService ppserverservice) {
		this.ppserverservice = ppserverservice;
	}
	
	
}
